// JavaScript Document

function include_js(path) 
{     
	document.write("<scr"+"ipt language=javascript src='"+path+"'></scr"+"ipt>");
};
include_js("/component/editors/tiny_mce/jquery.tinymce.js");

$(function() {
		$('textarea').tinymce({
			script_url : '/component/editors/tiny_mce/tiny_mce.js',
			mode : "exact",
			language : "cn",
			theme : "advanced",
			plugins : "inlinepopups,preview,syntaxhl",
			dialog_type : "window",
			theme_advanced_buttons1 : "fontselect,fontsizeselect,separator,bold,italic,underline,strikethrough, separator,forecolor,backcolor,separator,link,unlink,image,separator,code,syntaxhl",
　　		theme_advanced_buttons2 : "",
　　		theme_advanced_buttons3 : "",
        	theme_advanced_toolbar_location : "top",
			theme_advanced_toolbar_align : "left",
			theme_advanced_statusbar_location : "bottom",
			theme_advanced_resizing : false,
			file_browser_callback: 'imageUpload',
			
			content_css : "/component/prettify/prettify.css",
			
			relative_urls : false,
			remove_script_host : false,
			
		});	
	});
	
	function imageUpload(field_name, url, type, win){
		tinyMCE.activeEditor.windowManager.open({
			file : '/admin/image/upload',  //上传窗口的路径
			title : '上传图片',
			width : 420,
			height : 500,
			resizable : "no",
			inline : "yes",
			close_previous : "no"
		}, {
			window : win,  //告诉它是被谁弹出来的
			input : field_name  //这个是指生成的图片地址要往哪里填
		});
		return false;
	}